package com.rslai.base.tool.servertest.dsl;

import com.rslai.base.tool.servertest.config.StepConfig;
import com.rslai.base.tool.servertest.util.CloneUtil;

import java.util.List;
import java.util.Map;

public class DSLCommandDesc
        implements Cloneable {
    private String id;
    private String desc;
    private Boolean runOnce;
    private List<StepConfig> children;
    private Map<String, Map<String, Object>> data;

    public DSLCommandDesc(String id, String desc, Boolean runOnce, List<StepConfig> children, Map<String, Map<String, Object>> data) {
        this.id = id;
        this.desc = desc;
        this.runOnce = runOnce;
        this.children = children;
        this.data = data;
    }

    public String id() {
        return this.id;
    }

    public String desc() {
        return this.desc;
    }

    public Boolean runOnce() {
        return this.runOnce;
    }

    public List<StepConfig> children() {
        return this.children;
    }

    public Map<String, Map<String, Object>> data() {
        return this.data;
    }

    public Object clone() {
        DSLCommandDesc dslCommandDesc = null;
        try {
            dslCommandDesc = (DSLCommandDesc) super.clone();
        } catch (CloneNotSupportedException e) {
        }
        dslCommandDesc.children = CloneUtil.cloneStepConfig(this.children);

        return dslCommandDesc;
    }
}
